package com.dingreading.cloud.admin.controller;

import com.dingreading.cloud.admin.service.CourseTrainCommonService;
import com.dingreading.cloud.common.base.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.text.ParseException;

@RestController
@RequestMapping("/system/courseTrainLog")
@Api(tags = "总部-学院线下培训观看日志管理")
public class CourseTrainLogController {

    @Resource
    private CourseTrainCommonService courseTrainCommonService;

    @ApiOperation(value = "获取时间段门店")
    @PostMapping(value = "/getStores", produces = "application/json; charset=UTF-8")
    public R<Object> getStores(
            @ApiParam(value = "总部员工uid") @RequestParam(value = "headStaffUid") String headStaffUid,
            @ApiParam(value = "总部员工名") @RequestParam(value = "headStaffName") String headStaffName,
            @ApiParam(value = "开始日期") @RequestParam(value = "beginDate") String beginDate,
            @ApiParam(value = "结束日期") @RequestParam(value = "endDate") String endDate
    ) throws ParseException {
        return courseTrainCommonService.getStores(headStaffUid, headStaffName, beginDate, endDate);
    }
    @ApiOperation(value = "获取培训学习日志记录")
    @PostMapping(value = "/getList", produces = "application/json; charset=UTF-8")
    public R<Object> getList(
            @ApiParam(value = "总部员工uid") @RequestParam(value = "headStaffUid") String headStaffUid,
            @ApiParam(value = "总部员工名") @RequestParam(value = "headStaffName") String headStaffName,
            @ApiParam(value = "门店Uid") @RequestParam(value = "storeUid") String storeUid,
            @ApiParam(value = "开始日期") @RequestParam(value = "beginDate") String beginDate,
            @ApiParam(value = "结束日期") @RequestParam(value = "endDate") String endDate
    ) throws ParseException {
        return courseTrainCommonService.getList(headStaffUid, headStaffName, storeUid, beginDate, endDate);
    }
}
